Skip to content

ci(id): make the e2e nightly loud and bounded — watchdog, log artifact, per-check budgets (#1372) - #12582

Merged
dezren39 merged 2 commits into
mainfrom
archer-lane-i/1372-nixos-vm-test
Nov 22, 2026
Merged

dezren39 merged 2 commits into
mainfrom
archer-lane-i/1372-nixos-vm-test

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What

id-e2e-nightly.yml only — the check step becomes loud and bounded:

  • Watchdog heartbeat: every 5 minutes the step prints [nightly-watchdog] still running: phase=<phase>, watchdog elapsed <s>s, naming the current phase while the job runs.
  • Log capture: all check output is tee'd to flake-check.log and uploaded as the nightly-flake-check-log artifact in an if: always() step, so the evidence survives job cancellation/timeout and is attachable to an issue.
  • Step timeout 270 < job timeout 300, so the always() steps (disk telemetry, artifact upload) still run when the check step is killed.
  • Targeted dispatch: new workflow_dispatch input only_checks (space-separated check names). Each named check runs individually via nix build ./pkgs/id#checks.x86_64-linux.<name> -L under a per-check GNU timeout budget, logging [nightly] waiting on check '<name>' (budget <B>s) before it starts; a budget expiry is reported as check '<name>' exceeded its <B>s budget (rc=124), remaining checks still run, and the step ends with [nightly] targeted summary: failed checks: .... Budgets are build+test bounds (5400s default; 7200s for nixos-integration): a check derivation's build is its test, and the shared workspace build alone takes ~1h on this runner from a cold cache; each check's internal timeouts bound the test phase once built. Schedule runs (no input) execute the identical full nix flake check ./pkgs/id/ -L --keep-going as before.

Why

#1372's remaining complaint is opacity. Reproduced today on the first 300-minute nightly (run 45026136879, dispatched after #12526 raised the timeout): the run sat in the single check step for over an hour and a half with no per-check progress signal, and the job log visible via the API lagged ~25 minutes behind the runner (last visible line 13:59:58Z in downloads at 14:19Z/14:24Z while the job was in fact still building — confirmed when a later download showed content through 14:29:15Z). Slow and dead cannot be distinguished in real time, and nothing names which check the night is being spent on. The merged #4913 harness made the inside of the VM test legible once logs exist; this makes the workflow around it legible while it runs and after it is killed.

Verification (all four paths exercised in CI on this branch)

  • Pass path — run 45040420965: [nightly] check 'nix-fmt-check' passed; the same run continued to the next named check after it, proving the multi-check loop.
  • Fail path, named cause — run 45035241965 (nixos-serve): heartbeats 300s→2400s naming the phase, then [nightly] check 'nixos-serve' failed (rc=1); the log names the cause precisely — the id build's lib tests panic in the nix sandbox (reqwest: "No CA certificates were loaded from the system"), 3 http_fetch_* schedule tests, cascading to the test driver. That pre-existing defect is filed as id: http_fetch schedule tests panic in the nix build sandbox — reqwest finds no system CA certificates #12608; it, not this PR, blocks a nixos-serve pass. Run 45039552447 (cargo-fmt-check) and the second half of 45040420965 (just-recipes-drift) likewise failed with named pre-existing drift, filed as id: cargo-fmt-check and just-recipes-drift are red on main (format/generator drift) #12616.
  • Timeout path — run 45033002221 (nixos-serve, original 1200s budget): exceeded its 1200s budget (rc=124), summary named the check, artifact uploaded, post steps ran. This run also exposed the budget-sizing bug (kill landed mid-compile), fixed in this PR by sizing budgets as build+test bounds.
  • Local — YAML parses; embedded script passes bash -n; wrapper simulated with a stubbed nix across pass/fail/timeout paths; the watchdog leaves no orphaned sleep holding the step's stdout (setsid + process-group kill — a bug the first simulation caught and this PR fixes).

Refs #1372 (does not close it: the recorded close condition remains a completed full nightly verdict on nixos-integration, currently blocked by #12608 and #12616; the scheduled run 45038327413 is the next candidate).

The check step now runs under a watchdog: a heartbeat every 5 minutes naming the current phase, all output tee'd to flake-check.log and uploaded as an artifact even on cancellation, and a step timeout (270) below the job timeout (300) so the always() steps still run. A new workflow_dispatch input, only_checks, runs named checks individually under per-check GNU timeout budgets, ending with a summary naming every failed check — so a hang names its check instead of burning the whole night in one opaque step.

Evidence for the shape: the first 300-minute nightly (run 45026136879) sat in the single check step with its log frozen mid-compile (last line 13:59:58Z, byte-identical across downloads ~25 minutes apart) while the job stayed in_progress — indistinguishable from a hang until the job timeout fires.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 14:28
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c42e3676-04a5-4965-ae28-1f6980b16ed7
Commits

Reviewing files that changed from the base of the PR and between cd9e579 and a950c8f.

Files selected for processing: 1

  • .github/workflows/id-e2e-nightly.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T14:54:55.837894Z a950c8f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 284f1d9add

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +157 to +158
timeout --signal=TERM --kill-after=30s "$BUDGET" \
nix build "./pkgs/id#checks.x86_64-linux.$CHECK" -L 2>&1 | tee -a flake-check.log

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include wrapper diagnostics in the uploaded log

When a targeted check exceeds its budget, the named timeout diagnostic and failed-check summary are printed outside this tee pipeline, so neither appears in the uploaded flake-check.log. The watchdog output also bypasses the file. A quiet, stalled check can therefore produce an empty artifact even though the job console reports its timeout, defeating the artifact's purpose as attachable failure evidence. Capture the wrapper and watchdog output as well as the Nix subprocess output.

Useful? React with 👍 / 👎.

… lag evidence (#1372)

First targeted dispatch (run 45033002221) proved the naming and bounding machinery in CI — wait-target line, heartbeats naming the phase, rc=124 on budget expiry, summary naming the failed check, artifact uploaded — and exposed a sizing bug: nixos-serve was killed at its 1200s budget while still compiling the id crate. A check derivation's build is its test, and the shared workspace build alone takes ~1h on this runner from a cold cache, so budgets are now build+test bounds (5400s default; 7200s for nixos-integration), with each check's internal timeouts bounding the test phase once built. The header's frozen-log wording is also corrected: the API-visible log lagged ~25 minutes behind a job that was in fact still building.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant